package main

import (
	"bytes"
	"fmt"
)

func main() {
	s := []byte("stringr")
	b := s
	char := []byte("in")
	b1 := []byte("string2")
	bc := []byte("世界")
	bcd := "世界"
	//fmt.Println(s)
	fmt.Println(bytes.Compare(b, s))   //return 0
	fmt.Println(bytes.Compare(b1, s))  //return 1
	fmt.Println(bytes.Compare(s, b1))  //return -1
	fmt.Println(bytes.Equal(b, s))     //true
	fmt.Println(bytes.Contains(b1, s)) //true
	fmt.Println(bytes.Fields(s))       //use black sep
	fmt.Println(bytes.Count(s, char))  //count r
	fmt.Println(bc, len(bc), len(bcd))
	fmt.Println(bytes.Index(s, char))
	//fmt.Println()
	fmt.Println(bytes.IndexByte(s, char[0]))
	fmt.Println(bytes.Repeat(char, 2))
	fmt.Println(bytes.Runes(bc))
}
